<template>
    <div class="recent-contests">
        <div class="page-container">
            <div class="block1">
                <h2>欢迎使用 竞成网络安全竞赛平台</h2>
                <el-carousel :interval="5000" arrow="always" height="400px">
                    <el-carousel-item v-for="(imageSrc, index) in imageSources" :key="index">
                        <img :src="imageSrc" style="width: 100%; height: 100%;">
                    </el-carousel-item>
                </el-carousel>
            </div>
            <div class="block2">
                <!-- 近期比赛和过题榜单等内容 -->
            </div>
            <div class="block3">
                <!-- 公告内容 -->
            </div>
            <div class="block4">
                <!-- 提交统计图表内容 -->
            </div>
            <div class="block5">
                <!-- 最新题目列表内容 -->
            </div>
        </div>
    </div>
</template>

<script setup>
// 导入图片
import image1 from '../assets/images/image1.jpg';

const imageSources = [image1];
</script>

<style scoped>
.recent-contests {
    border: 1px solid #ccc;
    padding: 10px;
    margin-bottom: 10px;
}

.contest-item {
    margin-bottom: 5px;
}

.el-carousel__item h3 {
    color: #475669;
    font-size: 18px;
    opacity: 0.75;
    line-height: 300px;
    margin: 0;
}

.el-carousel__item:nth-child(2n) {
    background-color: #99a9bf;
}

.el-carousel__item:nth-child(2n+1) {
    background-color: #d3dce6;
}

.page-container {
    display: flex;
    flex-wrap: wrap;
    /* 允许换行 */
}

.block1 {
    flex: 1 1 50%;
    /* 占据一行，宽度为50% */
}

.block2 {
    flex: 1 1 50%;
}

.block3 {
    flex: 1 1 33.33%;
    /* 三分之一宽度 */
}

.block4 {
    flex: 1 1 33.33%;
}

.block5 {
    flex: 1 1 33.33%;
}
</style>